package com.itheima.a06threadmethod3;

public class ThreadDemo1 {
    public static void main(String[] args) {
        //熟悉守护线程

        //其他非守护线程结束后，守护线程也会陆续结束

        //1.创建线程对象
        MyThread1 t1 = new MyThread1();
        MyThread2 t2 = new MyThread2();
        //设置线程名称
        t1.setName("女神");
        t2.setName("备胎");
        //设置守护线程
        t2.setDaemon(true);
        //k开启线程
        t1.start();
        t2.start();

    }
}
